#include <iostream>
using namespace std;
#include "mem/small_buffer.h"
using namespace tdl;


int main(int argc, char* argv[])
{
	typedef small_buffer<512> sb_type;
	// allocate object and char[512] on stack
	sb_type sb1;

	// allocate object and char[512] on heap, using default new_allocator
	sb_type* psb1 = new sb_type();
	delete psb1;
	sb_type* psb2 = new sb_type[2];
	delete[] psb2;

	// allocate object on stack
	tdl::buffer sb2;
	// and allocate char[512] on heap, using default new_allocator
	sb2.allocate(512);
	// free(512) on heap
	sb2.deallocate();

	char* p = new char[100];
	buf_ref br(p, 100);
	delete p;

	return 0;
}

